// eslint-disable-next-line import/prefer-default-export
import moment from 'moment';

export const searchFormCfg = [
    {
        type: 'maxRangePicker',
        key: 'paid_time',
        label: '时间',
        rules: [{required: true}],
        props: {
            disabledDate(current) {
                // Can not select days after today
                return current && current > moment().endOf('day');
            },
            format: 'YYYY-MM-DD HH:mm',
            showTime: {format: 'HH:mm'},
            dayRange: 366,
        }
    },
    {
        type: 'select',
        key: 'teacher_nickname',
        label: '主讲老师',
        rules: [{required: true}],
        optionsConfig: {
            options: [],
            pager: {}
        },
        props: {
            showSearch: true,
            allowClear: true,
            selectAll: true,
            placeholder: '请选择主讲老师, 支持搜索',
        }
    },
    {
        type: 'select',
        key: 'clazz_number',
        label: '大班班级ID',
        rules: [{required: true}],
        optionsConfig: {
            options: [],
            pager: {}
        },
        props: {
            showSearch: true,
            allowClear: true,
            selectAll: true,
            placeholder: '请选择大班班级ID, 支持搜索',
        }
    }
];

export const selectUnitId = 'OrderCoreDataOverview_PartOne_select';

export const dashBoardsCfg = [
    {
        dashBoardId: 'OrderCoreDataOverview_PartOne',
        dashBoardName: 'OrderCoreDataOverview_PartOne',
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartTwo',
        dashBoardName: 'OrderCoreDataOverview_PartTwo',
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartFour',
        dashBoardName: 'OrderCoreDataOverview_PartFour',
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartThree',
        dashBoardName: 'OrderCoreDataOverview_PartThree',
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartFive',
        dashBoardName: 'OrderCoreDataOverview_PartFive',
    }
];

export const cardsCfg = [
    {
        dashBoardId: 'OrderCoreDataOverview_PartOne',
        dashBoardName: 'OrderCoreDataOverview_PartOne',
        unitId: ['OrderCoreDataOverview_PartOne_card_1', 'OrderCoreDataOverview_PartOne_card_2'],
        tooltip: ['支付金额', '支付人数'],
        defaultTitle: ['下单金额(元)', '下单人数']
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartTwo',
        dashBoardName: 'OrderCoreDataOverview_PartTwo',
        unitId: 'OrderCoreDataOverview_PartTwo_card',
        tooltip: '下单金额-退款金额。由于退款订单的下单时间可能在选定时间前，所以实收金额可能<0',
        defaultTitle: '实收金额(元)'
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartFour',
        dashBoardName: 'OrderCoreDataOverview_PartFour',
        unitId: 'OrderCoreDataOverview_PartFour_card',
        tooltip: '退款订单数/下单订单数 (排除部分退款订单)。由于退款订单的下单时间可能在选定时间前，所以退款率可能大于100%',
        defaultTitle: '退款率'
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartThree',
        dashBoardName: 'OrderCoreDataOverview_PartThree',
        unitId: 'OrderCoreDataOverview_PartThree_card',
        tooltip: '退款金额 (包括部分退款)',
        defaultTitle: '退款金额(元)'
    },
    {
        dashBoardId: 'OrderCoreDataOverview_PartFive',
        dashBoardName: 'OrderCoreDataOverview_PartFive',
        unitId: 'OrderCoreDataOverview_PartFive_card',
        tooltip: '退款人数 (排除部分退款)',
        defaultTitle: '退款人数'
    }
];
